package com.taptech.doufu.util.sp;

import android.os.Build;

/**
 * Created by wyt on 2017/2/12.
 */

public class DiaoBaoBaseSharedPreferences {
    public static void commitSharedPreferences(android.content.SharedPreferences.Editor editor){
        if(getAndroidSDKVersion() > Build.VERSION_CODES.GINGERBREAD) {
            editor.apply();
        }
        else{
            editor.commit();
        }
    }
    public static int getAndroidSDKVersion() {
        int version = 0;
        try {
            version = Integer.valueOf(android.os.Build.VERSION.SDK_INT);
        } catch (NumberFormatException e) {

        }
        return version;
    }
}
